package Sort;

import java.util.Arrays;

public class BinarySearch {
    public static void main(String[] args) {
        //要有序
        int[] a={1,3,3,5,6,9 };
        int key=5;
        int result= Arrays.binarySearch(a,key);
        System.out.println(result);
        if(result<0){
            System.out.println("未找到");
        }else{
            System.out.println("找到了");
        }
    }
}
